package io;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Scanner;

public class Test1 {
    public static void main(String[] args) throws IOException {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入字符串：");
        FileOutputStream fos =new FileOutputStream("node1.txt",true);
        while(true){
            String fileName = scanner.nextLine();
            if ("exit".equalsIgnoreCase(fileName)){
                break;
            }
            fos.write(fileName.getBytes(StandardCharsets.UTF_8));
        }
        fos.close();
    }
}
